<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>字符串可以是对象</title>
</head>

<body>
    <p id="demo"></p>
    <script>
        var x = "John";              // x是一个字符串
        var y = new String("John");  // y是一个对象
        document.getElementById("demo").innerHTML = typeof x + " " + typeof y;
    </script>
</body>

</html>